feat(ui): full access mode — opt-in auto-run without destructive-command pause (PR 0004) - #167
Open
tokg-venv wants to merge 3 commits into
Open
feat(ui): full access mode — opt-in auto-run without destructive-command pause (PR 0004)#167tokg-venv wants to merge 3 commits into
tokg-venv wants to merge 3 commits into
Conversation
added 3 commits
September 8, 2026 21:06
…and pause (PR 0004) Add an opt-in 'Full access mode' for users who run the agent unattended on their own machine. When enabled together with auto-run tools, auto-run no longer pauses on bash commands flagged destructive (isDangerousBashCommand): every tool call executes automatically. Safety posture: - Off by default; only affects local auto-run behavior (no runtime layer). - First-time enable requires an explicit, unskippable risk acknowledgement dialog (destructive confirm). Reinstall/cleared storage re-asks. - A persistent amber 'Full access' badge stays visible in the toolbar while the mode is on; each run shows a dismissible warning toast. - Scope is limited to the destructive-bash pause: control-flow tools such as 'terminate' remain never-auto-executed. Without auto-run enabled the mode has no effect. - run-mode.ts: get/setFullAccessMode + get/setFullAccessAcknowledged (localStorage) + useSyncExternalStore subscription; useRunMode exposes fullAccessMode. - thread-store.ts: getFullAccessMode option read fresh at run time; bash interception skips the pause when enabled; per-run warning toast. - thread-playground.tsx: wires the option through and renders the badge. - Experimental settings: toggle + confirmation dialog (en/zh copy). Tests: thread-store-full-access.test.ts — dangerous bash auto-runs when mode is on, pauses when off, acknowledged flow, badge wiring.
The destructive-bash gate read full access mode once, before a batch that contains a Plugin Tool resolved its prompt variables. That resolution is a real await, so switching the mode off while the batch was being prepared still ran the batch — including a bash command flagged destructive. - thread-store.ts: gate through `isRiskPaused`, which reads the mode on every check, and run the gate again after the asynchronous preparation, immediately before anything executes. - thread-store-full-access.test.ts: mid-batch regression test (it executes both tools before this change and nothing after) plus a control that a Plugin Tool batch still auto-runs while the mode stays on. - run-mode.test.ts: cover the stored full-access state the settings acknowledgement flow depends on (off and unacknowledged by default, the acknowledgement and the mode on separate keys, cleared storage asks again).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Implements spec 0004: an opt-in "Full access mode" for users who run the agent unattended on their own machine. When enabled together with auto-run tools, auto-run no longer pauses on bash commands flagged destructive (
isDangerousBashCommand): every tool call executes automatically.Safety posture (deliberate guardrail trade-off — please scrutinize):
terminateremain never-auto-executed. Without auto-run enabled, the mode has no effect.Details
run-mode.ts:get/setFullAccessMode+get/setFullAccessAcknowledged(localStorage) +useSyncExternalStoresubscription;useRunModeexposesfullAccessModethread-store.ts:getFullAccessModeoption read fresh at run time; the destructive-bash interception skips the pause only when enabled; per-run warning toastthread-playground.tsx: wires the option through and renders the badgeTest plan
thread-store-full-access.test.ts: dangerous bash auto-runs when the mode is on, pauses when off, acknowledgement flow, badge wiring — passesbun run typecheck:changed/bun run lint:changedclean